<?php

namespace App\Http\Controllers\user;

use App\Dao\OrdersDao;
use App\Dao\ProjectDao;
use App\Dao\VipDao;
use App\Services\Logger;
use App\Services\PayServices;
use EasyWeChat\Kernel\Exceptions\Exception;

class NoticeController extends BaseController
{
    public function notice(){
        Logger::info("=======>支付回调");
        $result = PayServices::get_app()->handlePaidNotify(function ($message,$fail){

            VipDao::changeVip($message['out_trade_no']);

        });
    }


    /**
     * @throws Exception
     */
    public function notice_goods(){
        Logger::pay_success("=======>支付回调");
        $result = PayServices::get_app()->handlePaidNotify(function ($message,$fail){

            OrdersDao::changeOrder($message['out_trade_no']);

        });
    }
}
